﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Data;
using IQKS.AWP.DataAccessLayer;
using IQKS.AWP.BusinessObject;

namespace IQKS.AWP.BusinessAccessLayer
{
    public class RoleMasterBAL
    {
        public DataSet GetRoleAssessor()
        {
            DataSet objDs;
            try
            {
                objDs = new RoleMasterDAL().GetRoleAssessor(0);

            }
            catch (Exception exception)
            {
                throw new ApplicationException(exception.Message);
            }
            return objDs;
        }


        public DataSet GetAllRole()
        {
            DataSet objDs;
            try
            {
                objDs = new RoleMasterDAL().GetAllRole();

            }
            catch (Exception exception)
            {
                throw new ApplicationException(exception.Message);
            }
            return objDs;
        }
        public DataSet GetAllRoleDetails()
        {
            DataSet objDs;
            try
            {
                objDs = new RoleMasterDAL().GetAllRoleDetails();

            }
            catch (Exception exception)
            {
                throw new ApplicationException(exception.Message);
            }
            return objDs;
        }


        public RoleMasterBO GetRoleAssessor(params object[] param)
        {
            RoleMasterBO objLMBo;
            try
            {
                objLMBo = new RoleMasterBO();
                DataSet objDs;
                objDs = new RoleMasterDAL().GetRoleAssessor(param);
                if (objDs != null)
                {
                    DataTable objDt = objDs.Tables[0];
                    if (objDt != null)
                    {
                        objLMBo.RoleId = Guid(objDt.Rows[0]["RoleId"]);
                        //objLMBo.RegionID = Convert.ToInt32(objDt.Rows[0]["RegionID"]);
                        objLMBo.RoleTitle = Convert.ToString(objDt.Rows[0]["RoleTitle"]);
                       
                    }
                    else
                    {
                        objLMBo = null;
                    }
                }

            }
            catch (Exception exception)
            {
                throw new ApplicationException(exception.Message);
            }
            return objLMBo;
        }

        private Guid Guid(object p)
        {
            throw new NotImplementedException();
        }

    }
}
